package cn.dnui_xqh414.dnuifood_16110100414.model;


import java.util.List;

import cn.dnui_xqh414.dnuifood_16110100414.bean.AllshopBean;
import cn.dnui_xqh414.dnuifood_16110100414.bean.CollectBean;
import cn.dnui_xqh414.dnuifood_16110100414.bean.Collectstate;
import cn.dnui_xqh414.dnuifood_16110100414.bean.GetAllCollectBean;
import cn.dnui_xqh414.dnuifood_16110100414.iface.ShopIface;
import cn.dnui_xqh414.dnuifood_16110100414.listener.OnRetrofitListener;
import cn.dnui_xqh414.dnuifood_16110100414.service.ShopService;
import retrofit2.Call;
import retrofit2.http.Query;

public class ShopModel extends BaseModel
        implements ShopIface {
    private ShopService shopService;

    public ShopModel()
    {
        super();
        shopService = retrofit.create(ShopService.class);
    }
    @Override
    public void getAllshops(OnRetrofitListener listener) {

        Call<List<AllshopBean>> call = shopService.getAllShop();
        bindCallBack(call,listener,3);

    }

    @Override
    public void getCollectstate(int userID, int shop_food_id,int flag, OnRetrofitListener listener) {
        Call<Collectstate> call = shopService.getCollect(userID,shop_food_id ,flag);
        bindCallBack(call,listener,4);
    }

    @Override
    public void doCollect(int userID, int shopID, OnRetrofitListener listener) {
        Call<CollectBean> call = shopService.doCollect(userID,shopID);
        bindCallBack(call,listener,5);
    }

    @Override
    public void doFoodListCollect(int userID, int foodID, OnRetrofitListener listener) {
        Call<CollectBean> call = shopService.doFoodCollect(userID,foodID);
        bindCallBack(call,listener,6);
    }

    @Override
    public void getAllCollect(int userID, int flag, OnRetrofitListener listener) {
        Call call = shopService.getAllcollect(userID,flag);
        bindCallBack(call, listener , 7);
    }

    @Override
    public void getShopById(int ShopId, OnRetrofitListener listener) {
        Call call = shopService.getShopById(ShopId);
        bindCallBack(call,listener,8);
    }
}
